package com.gmrz.webauthn.protocol.v1.schema;

import com.gmrz.webauthn.protocol.v1.processor.WebAuthnException;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.Arrays;


public class AuthenticatorAttestationResponse
        implements AuthenticatorResponse {
    @Expose
    @SerializedName("clientDataJSON")
    private byte[] clientDataBytes;
    private CollectedClientData clientData;
    private byte[] attestationObject;
    private CredentialAttestation credentialAttestation;

    public byte[] getClientDataBytes() {
        return this.clientDataBytes;
    }

    public byte[] getAttestationObject() {
        return this.attestationObject;
    }

    public void setClientDataBytes(byte[] clientDataBytes) {
        this.clientDataBytes = clientDataBytes;
    }

    public void setClientData(CollectedClientData clientData) {
        this.clientData = clientData;
    }

    public void setAttestationObject(byte[] attestationObject) {
        this.attestationObject = attestationObject;
    }

    public void setCredentialAttestation(CredentialAttestation credentialAttestation) {
        this.credentialAttestation = credentialAttestation;
    }


    public CredentialAttestation getCredentialAttestation() {
        return this.credentialAttestation;
    }

    public CollectedClientData getClientData() throws WebAuthnException {
        return this.clientData;
    }

    public String toString() {
        return "AuthenticatorAttestationResponse [clientDataBytes=" + Arrays.toString(this.clientDataBytes) + ", clientData=" + this.clientData + ", attestationObject=" + Arrays.toString(this.attestationObject) + ", credentialAttestation=" + this.credentialAttestation + "]";
    }
}
